<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>事件处理</title>
	</head>
	<body>
		<div id="root">
			<h3>学校名称:{{name}}</h3>
			<h3>学校地址:{{address}}</h3>
			<button @click="showInfo1">点我弹提示1(不传参)</button>
			<button @click="showInfo2($event,888)">点我弹提示2(传参)</button>
		</div>
		<script src="./js/vue.js"></script>
		<script>
			// 阻止vue在启动时生成生成提示
			Vue.config.productionTip = false
			const vm = new Vue({
				el:'#root',
				data:{
					name:'星桥中心小学',
					address:'FFDSFDF'
				},
				methods: {
					showInfo1(event) {
						console.log(event.target.innerText);
						console.log(this);
						console.log(this == vm);
						alert('你好呀!');
					},
					showInfo2(event,num) {
						console.log(num);
						alert('你好呀!!');
					}
				},
			});
		</script>
	</body>
</html>